package com.example.chengche_lol.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.chengche_lol.R;
import com.example.chengche_lol.beans.NewsArticleBean;

import org.jetbrains.annotations.NotNull;

public class NewsArticleAdapter extends BaseQuickAdapter<NewsArticleBean, BaseViewHolder> {

    public NewsArticleAdapter() {
        super(R.layout.item_news_article);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, NewsArticleBean newsArticleBean) {
        baseViewHolder.setText(R.id.article_title,newsArticleBean.getTitletext());
        baseViewHolder.setImageResource(R.id.img_cover,newsArticleBean.getImageView());
        baseViewHolder.setText(R.id.tv_tag,newsArticleBean.getTag());
        baseViewHolder.setText(R.id.article_user,newsArticleBean.getUser());
        baseViewHolder.setText(R.id.tv_view_number,newsArticleBean.getViewnumber());
    }

}
